import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    uid: 0,
    userInfo: {},
    pid: '',
    pmin: 0
  },
  mutations: {
    SET_UID: (state,uid) => {
      state.uid = uid
    },
    SET_USER: (state,user) => {
      state.userInfo = user
    },
    SET_PID: (state,pid) => {
      state.pid = pid;
    },
    SET_PMIN: (state,min) =>{
      state.pmin = min;
    }
  },
  getters: {
    getAccount(state) {
      return state.userInfo.account;
    }
  },
  actions: {
  },
  modules: {
  }
})
